import axios from 'axios'
import dwSign from "@/utils/axios/dwSign.js";


const server = axios.create({
  baseURL: import.meta.env.VITE_API_URL,
  withCredentials: false,
  timeout: 0,
  headers: {
    "Accept": 'application/json', 'Content-Type': 'application/json',
  }
})

const requestInterceptor = (request) => {
  let signRequest = dwSign(request);
  return signRequest
}

const responseInterceptor = (response) => {
  return response
}

server.interceptors.request.use(requestInterceptor, (error) => {
  return Promise.reject(error)
})

server.interceptors.response.use(responseInterceptor)

export default server;
